package com.seecen.HJM.model.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

@Data
public class AdminDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "管理员用户名不能为空")
    @Size(min = 4, max = 16, message = "管理员用户名长度必须为4-16位")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "管理员用户名只能包含字母、数字和下划线")
    private String username;

    @NotBlank(message = "管理员的密码不能为空")
    @Size(min = 6, max = 20, message = "管理员密码长度为6-20")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).+$", message = "管理员密码必须同时包含字母和数字")
    private String password;

    @NotBlank(message = "验证码不能为空")
    private String code;
}
